/**
 * 2016，thor.com，all rights reserved。
 * 
 * Project：		palmmall-core
 * Filename：	SAuthenInfoConverter.java
 * Created：		2016年7月30日
 * Creator：		wolv
 */
package com.thor.palmmall.rest.user.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.user.AAuthenInfo;
import com.thor.palmmall.spi.user.SAuthenInfo;

/**
 * @author wolv
 *
 */
public class SAuthenInfoConverter implements Converter<AAuthenInfo, SAuthenInfo> {

	public static SAuthenInfoConverter getInstance() {
		if (instance == null)
			instance = new SAuthenInfoConverter();
		return instance;
	}

	private static SAuthenInfoConverter instance;

	private SAuthenInfoConverter() {
	}

	@Override
	public SAuthenInfo convert(AAuthenInfo source) {
		if (source == null)
			return null;

		SAuthenInfo target = new SAuthenInfo();
		target.setPassword(source.getPassword());
		target.setPrincipal(source.getPrincipal());

		return target;
	}
}
